#ifndef __THREAD_POOL__
#define __THREAD_POOL__
#include <func.h>
#include "taskQueue.h"
#include "mandate.h"
#define NETDISK_LOG_INFO(user,cmd,arg)        \
do{                                       \
    syslog(LOG_INFO,"%s %s %s",user,cmd,arg);        \
}while(0);

typedef struct threadPool_s {
    pthread_t *tidArr;
    int workerNum;
    taskQueue_t taskQueue;
    int exitflag;
} threadPool_t;
typedef struct train_s {
    int length;
    char data[1000];
} train_t;
int initThreadPool(threadPool_t *threadPool, int workerNum);
int makeWorker(threadPool_t *threadPool);
void *threadFunc(void *arg);
int epollAdd(int epfd, int fd);
int epollDel(int epfd, int fd);
int tcpInit(const char *ip, const char *port, int * psockfd);
int transfile(int netfd,char *filename);
int recvn(int netfd, void *buf, int length);
int recv_msg(int netfd,char *buf);
int send_msg(int netfd,char *buf);
int recvfile(int netfd);
int getsfile(int netfd,char* filename);
#endif
